package logic

import (
	"context"

	"mall/service/mqueue/job/internal/svc"

	"github.com/hibiken/asynq"
)

type ScanAttachmentLogDeletedProcessor struct {
	svcCtx *svc.ServiceContext
}

func NewScanAttachmentLogDeletedProcessor(svcCtx *svc.ServiceContext) *ScanAttachmentLogDeletedProcessor {
	return &ScanAttachmentLogDeletedProcessor{
		svcCtx: svcCtx,
	}
}

// every five minutes exec : if return err != nil , asynq will retry
func (l *ScanAttachmentLogDeletedProcessor) ProcessTask(ctx context.Context, t *asynq.Task) error {
	// logrus.Info(fmt.Sprintf("ScanAttachmentLog Task: %+v", t))
	// &{typename:schedule:scan:attachmentLog payload:[] opts:[] w:0xc0007b1480}
	//todo:待实现
	//res, err := l.svcCtx.AttachmentRpc.BackendGetAttachmentLogList(ctx, &attachmentclient.AttachmentLogListReq{
	//	PageSize: uint64(50),
	//	RMQStep:  pointy.GetPointer(uint32(1)),
	//})
	//if err != nil {
	//	logx.Errorw("ScanAttachmentLogDeletedProcessor err", logx.Field("detail", err.Error()))
	//	return fmt.Errorf("ScanAttachmentLogDeletedProcessor err: %+v: %w ", err, asynq.SkipRetry)
	//}

	return nil
}
